Making Your Own Luck: Weak Vertical Swimming Improves Dispersal Success for Coastal Marine Larvae

Dispersive early life stages are common in nature. Although many dispersing organisms (“propagules”) are passively moved by outside forces, some improve their chances of successful dispersal through weak movements that exploit the structure of the environment to great effect. The larvae of many coastal marine invertebrates, for instance, swim vertically through the water column to exploit depth-varying currents, food abundance, and predation risk. Several swimming behaviors and their effects on dispersal between habitats are characterized in the literature, yet it remains unclear when and why these behaviors are advantageous. We addressed this gap using a mathematical model of larval dispersal that scored how well behaviors allowed larvae to simultaneously locate habitats, avoid predators, and gather energy. We computed optimal larval behaviors through dynamic programming, and compared those optima against passive floating and three well documented behaviors from the literature. Optimal behaviors often (but not always) resembled the documented ones. However, our model predicted that the behaviors from the literature performed robustly well, if not optimally, across many conditions. Our results shed light on why some larval behaviors are widespread geographically and across species, and underscore the importance of carefully considering the weak movements of otherwise passive propagules when studying dispersal. Supplementary Information The online version contains supplementary material available at 10.1007/s11538-023-01252-2.

specific species.However, it was nonetheless important to choose physically and biologically justifiable values for these parameters.Those values were presented in Table 1 of the main text, and are justified below.

Distance-Based Quantities
All distance-based quantities, including current velocities and eddy diffusivity, were defined relative to the size of a typical adult coastal habitat, h, for the theoretical species of interest.Habitats sizes range from a few meters (e.g., for animals inhabiting small rocky reefs) to 10 km or more (e.g., for animals capable of surviving at various depths) (Nickols et al, 2015;Rasmuson, 2013).Shanks (1995) states that cross-shore current velocities, u, in coastal environments frequently fall in the range 0-25 km d −1 .Using the more conservative ranges 1 ≤ h ≤ 10 km and 0 ≤ u ≤ 10 km d −1 resulted in dimensionless velocities U = u/h in the range 0-10 d −1 .This parameter had the greatest qualitative effect on optimal swimming behaviors in the range 0 ≤ U ≤ 2, so we chose U = 1 as a default value for upwelling scenarios.Largier (2003) and Nickols et al (2012) describe cross-shore eddy diffusivities, k, ranging from 10-100 km 2 d −1 .This resulted in dimensionless diffusivities K = k/h 2 in the range 0.1-100 d −1 .We chose the conservative default value K = 0.2 d −1 to obtain a system in diffusion did not dominate advection.
Finally, recall from the main text that in our two-layer upwelling system, the surface layer had offshore velocity U 1 = U and cross-shore diffusivity K 1 = K, while the lower layer had velocity U 0 = −αU and diffusivity K 0 = αK for some constant α.The constraint 0 < α < 1 was intended to capture the typical upwelling scenario in which currents in the thin surface layer are stronger than those in the thick bottom layer, but the exact choice α = 0.25 was arbitrary and did not qualitatively change our results.

Energetic Quantities
All energetic quantities, including the rates of energy uptake and expenditure on maintenance, growth, and locomotion, were defined relative to the energetic cost of metamorphosis, m.Establishing reasonable values for these quantities was particularly challenging because previously published studies differ in their study organisms, laboratory protocols, and reporting methods.We were unable to find complete energy budgets for any species; however, we based many of our parameter estimates on the studies of Balanus balanoides and Mytilus edulis published by Lucas et al (1979) and Sprung (1984a,b), respectively.
According to Lucas et al (1979), B. balanoides larvae require about m = 125 mJ of energy for metamorphosis, and may store up to an additional 210 mJ of energy for "swimming and exploration."This suggests a maximum larval energy store of about 3m or more.We used 5m (that is, E max = 5) to avoid overly constraining our optimization problem.In low food simulations, larvae rarely contained more than 3m mJ at once, while in high food simulations, larvae often reached their maximum of 5m.However, the same results would be attained using a different choice of maximum and proportionally different definitions of "low" and "high" food abundance.Lucas et al (1979) also observed that larva's 210 mJ energy surplus typically lasted 2.5 to 4 weeks, suggesting an average metabolic rate, g, of 7.5-12 mJ d −1 .We used the upper end of this range to obtain a dimensionless metabolic rate, G = g/m, of 0.1 d −1 .We chose dimensionless rates of energy uptake (that is, feeding), F , of similar magnitude to G so that modeled larvae would neither be forced to starve (if F < G) or easily meet their energetic needs (if F ≫ G).The value F = 0.2 was a convenient default.
Finally, Sprung (1984b) suggested that M. edulis larvae may direct up to 20% of their energy expenditure toward locomotion while swimming at a rate of 2 mm s −1 .This suggests that the cost of swimming is 0.25G d −1 .The speed 2 mm s −1 is typical for larvae of many marine invertebrates (Chia et al, 1984).For the purposes of estimating the cost of a single vertical migration, we assumed that the water column had a uniform depth with a bottom layer 50 m thick and a surface layer 12.5 m thick.We assumed that, on average, vertical migrations transported larvae from the middle of one layer to the middle of the other, covering a distance of 31.25 m.A larva swimming or sinking at speed 2 mm s −1 would travel this distance in about 0.2 d, resulting in a total energy expenditure of As a default, we rounded this value down to V = 0.004.However, we also assumed that modeled larvae were neutrally buoyant-rather than passively sinking from the surface to the bottom, they needed to actively swim downward.We assumed upward and downward vertical migrations both cost V units of energy.Since a modeled larva must perform a nearly equal number of upward and downward migrations, this is equivalent to modeling a larva for which swimming upward costs 0.008 units of energy, but swimming downward costs 0.

Passive Drifting
In our two-layer upwelling scenario, the vertical position of a modeled larva takes one of two values: Z t = 0 when the larva is in the bottom layer, and Z t = 1 when the larva is in the surface layer.Passively drifting larvae were modeled as switching between these two states at random intervals (main text Figure 2A.I).These switches occurred according to an underlying random walk simulation in the water column.As in Supplement 1, suppose that the surface and bottom layers of the coastal environment have thicknesses 12.5 m and 50 m, respectively.Let z(t) ∈ [−50, 12.5] represent the depth at time t of a larva in this environment, such that the underlying states z(t) < 0 and z(t) > 0 correspond with observed states Z t = 0 and Z t = 1, respectively.We assumed the larva was spawned from a random depth within the lower layer, and then changed depth over time according to a continuous-state random walk: (2.1)  (Barton et al, 2001;Hamilton and Jr., 1978;Haskell et al, 2015;Waldron and Probyn, 1991).We used this extreme value as the default, k z = 100, because for smaller values of k z , the process z(t) rarely exited the lower layer at all.Using k z = 100, larvae spend about 18% of the larval duration in the surface.Because vertical advection is often very weak- Haskell et al (2015) reported upward velocities less than 1 m d −1 in the Eastern Tropical South Pacific upwelling system-we omitted it from our passive drifting model.
A single realization of this process and the expected proportion of the larval duration this process spends in each layer are shown in Figure S2.1.
Results Section 3.2 in the main text discusses optimized larval trajectories in five biological scenarios and eight environmental scenarios.The biological scenarios included feeding and nonfeeding larvae with a 20-day larval duration; feeding larvae with the same larval duration, but spawned with insufficient energy for maintenance through dispersal; and feeding larvae with 6-day and 80-day larval durations.The environmental scenarios included all triplets of nearshore versus diurnal predation, still water versus upwelling, and low versus high food abundance (or energy surplus size, for nonfeeding larvae).Generalities and important similarities and differences across these scenarios are summarized in the main text and  S3.1 is identical to main text Figure 3A.
General description and similar archetypes.Optimal trajectories always visit the surface at the start of dispersal.Surface visits occur throughout dispersal, and are particularly likely at the end of dispersal (unless the larval duration is short, T = 6 days).With no directed currents to contend with, optimal larval trajectories frequently finished dispersal within the nearshore habitat, X T < 1.Since feeding larvae could visit the surface to feed without a large risk of offshore transport, no optimal trajectories hit starvation (that is, E t > 0 for all 0 ≤ t ≤ T ) and all optimal trajectories finished dispersal with adequate energy for metamorphosis (E T ≥ 1).On the other hand, increased diffusion in the surface probably encouraged some movement away from nearshore predators and toward the nearshore habitat at the start and end of dispersal.On average, the optimal vertical swimming policy did not resemble any of the archetypes we considered.
Effects of nutritional mode.Optimal swimming policies were nearly identical for larvae spawned with adequate energy for maintenance (row A) and nonfeeding larvae spawned with adequate energy for maintenance and metamorphosis (row B).
Effects of energy at spawning.When food was abundant, optimal trajectories for feeding larvae with 20-day larval durations were not strongly affected by energy at spawning (Figure S3.2, rows A and C).When food was limited, larvae spawned with less energy spent more time in the surface during the second half of dispersal Effects of larval duration.For feeding larvae with a 6-day larval duration, optimal trajectories spent a large fraction of dispersal in the surface to quickly gather energy for metamorphosis-with low food abundance, trajectories may reside in the surface for the entirety of dispersal (Figures S3.1D   Effects of nutritional mode.For both feeding and nonfeeding larvae with a 20-day larval duration, optimal dispersal trajectories began with a visit to the surface.This similarity indicated that the purpose of this visit was to achieve offshore transport, rather than to feed. Effects of energy at spawning, food abundance, and surplus size.For nonfeeding larvae, a greater energy surplus at spawning favored fewer, shorter surface visits throughout dispersal aimed at maintaining a safe offshore distance.Regardless of surplus size, however, these visits ceased a couple days before settling to promote onshore transport (Figures S3.3B and S3.4B).
For feeding larvae, energy limitations (whether due to food abundance or energy at spawning) promoted surface visits until the very end of dispersal to avoid settling with insufficient energy for metamorphosis (Figures S3.3 and S3.4,rows A and D).When larvae were spawned without enough energy for maintenance throughout dispersal, optimal trajectories visited the surface at the end of dispersal even if it resulted in transport away from the nearshore habitat (Figures S3.3 and S3.4,rows C and E).It is not clear that a species whose larvae have these energy constraints could persist without abundant food in the environment.
Effects of larval duration.Over a larval duration of T = 20 days, optimal larval trajectories visited the surface for the first 2-10 days of dispersal on average, in an OVM-like fashion (Figures S3.3AGeneral description and similar archetypes.Under these conditions, optimal larval trajectories almost exclusively visited the surface nocturnally.Corresponding larval swimming policies resembled, to varying degrees, either the DVM or Hybrid archetypes.In a few cases, optimal larval trajectories visited the surface nearly every night to feed.More often, however, these visits were concentrated near the start of dispersal. Effects of nutritional mode.Nonfeeding larvae had little need to visit the surface.However, they tended to do so at the end of dispersal (rather than the beginning, as in the Hybrid behavior) to exploit the surface layer's greater diffusivity, increasing their chances of quickly drifting toward shore (Figures S3.5B Effects of energy at spawning.Optimal trajectories of larvae spawned with insufficient energy for maintenance visited the surface nearly every night if food was scarce (Figures S3.5,rows C and E).This was necessary to avoid starvation and settling with insufficient energy.When food was abundant, optimal trajectories were more similar to the Hybrid behavior, regardless of energy at spawning (except over larval duration T = 6; see Figure S3.6, rows A, C, E).
Effects of food abundance/surplus size.Energy surplus size for nonfeeding larvae had a minimal effect on optimal trajectories (Figures S3.5B and S3.6B).For feeding larvae, more abundant food allowed optimal trajectories to cease visiting the surface nightly earlier into dispersal (Figures S3.5 and S3.6, rows A and C-E).
Effects of larval duration.Over the short larval duration T = 6 and with low food abundance, optimal trajectories remained in the surface for most of dispersal to gather enough food for metamorphosis (Figure S3.5D).Increased food abundance allowed larvae to gather energy more quickly, permitting a more DVM-like behavior (Figure S3.6D).

Upwelling with Diurnal Predation
Optimal larval trajectories with these conditions are shown in Figures S3.7 (low food abundance) and S3.8 (high food abundance).Row A of Figure S3.7 is identical to main text Figure 3D.
General description and similar archetypes.Optimal vertical swimming policies under these conditions resembled the Hybrid and DVM archetypes, depending on energy availability (e.g., through food or surpluses at spawning).Larvae visited the surface nearly exclusively at night, and did so most often at the start of dispersal.
Later surface visits allowed larvae to avoid starvation and settle with adequate energy for metamorphosis, but sometimes came at the price of settling far from shore (e.g., Figure S3.7, rows C and E).
Effects of nutritional mode.Nonfeeding larvae had no incentive to visit the surface under upwelling conditions: they received no benefit through feeding, and any possibility of diffusing toward shore was overpowered by the certainty of offshore advection (Figures S3.7 Effects of food abundance/surplus size.Like energy at spawning, food in the surface allowed larvae to stop visiting the surface nightly earlier in dispersal (compare Figures S3.7 and S3.8).This was especially noticeable when larvae were spawned with insufficient energy for maintenance, as noted above.
Effects of larval duration.Most observations above are independent of larval duration.For larvae with a 20-day larval duration, optimal trajectories visited the surface at least the first 2-5 nights of dispersal, and continued to do so as needed to gather energy before settling (Figures S3.7    .1:Relationships between Trajectory Scores, J, and upwelling current velocities, U , for optimal vertical swimming behaviors (red in all panels), (A) passive drifting (gray), (B) the DVM archetype (purple), (C) the OVM archetype (orange), and (D) the Hybrid archetype (blue).We considered both the nearshore and diurnal predation schemes (rows I and II, respectively).Parameters besides U were held at the default values in main text Table 1.At U = 0 (U = 1, vertical dotted lines), conditions were identical to those in main text Figures 3A  and C (B and 3)..2:Relationships between Trajectory Scores, J, and feeding rate (a proxy for food abundance), F , for optimal vertical swimming behaviors (red in all panels), (A) passive drifting (gray), (B) the DVM archetype (purple), (C) the OVM archetype (orange), and (D) the Hybrid archetype (blue).We considered both the nearshore and diurnal predation schemes (rows I and II, respectively).Parameters besides F were held at the default values in main text Table 1.At F = 0.2 (vertical dotted lines), conditions were identical to those in Figure 3B and D.

Different Biological Scenarios
We repeated the analyses in Sections 3.3 of the main text under two alternate biological scenarios.While the main text considered feeding larvae with a larval duration of 20 days spawned with enough energy for maintenance throughout development, here we considered nonfeeding larvae spawned with enough energy for maintenance and metamorphosis and feeding larvae spawned with insufficient energy for maintenance, both with 20-day larval durations.

Nonfeeding Larvae
Trajectory Scores J depended on U almost identically for feeding and nonfeeding larvae using the DVM, OVM, and Hybrid behavioral archetypes (compare main text Figure 4 to Figure S4.3, columns B-D).Trajectory Scores were slightly greater for nonfeeding larvae because larvae were spawned with enough energy for maintenance and metamorphosis, and almost always finished dispersal with E T ≈ 1 or greater.Passive drifting was more successful for nonfeeding larvae on average, also because simulated larvae were not responsible for gathering food (Figure S4.3).For passive drifting, Trajectory Scores were less varied for nonfeeding larvae than feeding Figure S4.3:Relationships between Trajectory Scores, J, and upwelling current strength, U , for optimal vertical swimming behaviors (red in all panels), (A) passive drifting (gray), (B) the DVM archetype (purple), (C) the OVM archetype (orange), and (D) the Hybrid archetype (blue) for nonfeeding larvae.We considered both the nearshore and diurnal predation schemes (rows I and II, respectively).Parameters besides U were held at the default values for nonfeeding larvae in Table 1.At U = 0 (U = 1, vertical dotted lines), conditions were identical to those in main text Figures 3A and C (B and D).
larvae given nearshore predation, since Scores were not affected by randomness in the amount of food gathered (Figures 4 and S4.3,row I).With diurnal predation, Trajectory Scores were more varied for nonfeeding than feeding larvae, perhaps because for nonfeeding larvae the negative effects of visiting the surface (predation and offshore transport) were not canceled out by the benefits of feeding (Figures 4 and S4.3,row I).Finally, in nearshore predation, Trajectory Scores due from swimming optimally increased with respect to current strength U , since upwelling allowed larvae to advect away from nearshore predators and then toward the nearshore habitat.In diurnal predation, Trajectory Scores were identically 1 for U greater than about 0.2-as noted in Section 3.2.2,nonfeeding larvae in strong advection had no incentive to leave the bottom layer.
Rather than varying food abundance, we varied the size of the energy surplus with which nonfeeding larvae were spawned, S. Recall that E 0 = GT + S where G was the rate of energy use for maintenance, so that larvae were spawned with sufficient energy for maintenance during development.Since metamorphosis cost 1 energy unit and nonfeeding larvae had no means of acquiring additional energy, we only considered values of S ≥ 1.
Due to the small estimated cost of vertical migrations, Trajectory Scores were completely unaffected by S for all behavioral archetypes considered.The only exception was when S ≈ 1 for DVM, where frequent vertical settling with enough energy for metamorphosis, all for nonfeeding larvae with the default parameters in Table 1.Bars represent mean scores, with dark (light) bars corresponding with the nearshore (diurnal) predation schemes.
Settling and Metamorphosis Scores did not depend on predation schemes, except that optimal behaviors were different for each scheme.Error bars represent interquartile ranges.
migrations resulted in E T slightly under 1 and slightly lower Trajectory Scores.
The five behaviors we considered were similarly suitable for feeding and nonfeeding larvae for helping larvae avoid predation, settle close to shore, settle with adequate energy for metamorphosis, and survive from spawning .6:Relationships between Trajectory Scores, J, and feeding rate (a proxy for food abundance), F , for optimal vertical swimming behaviors (red in all panels), (A) passive drifting (gray), (B) the DVM archetype (purple), (C) the OVM archetype (orange), and (D) the Hybrid archetype (blue) for feeding larvae spawned with insufficient energy for maintenance, E 0 = 1.We considered both the nearshore and diurnal predation schemes (rows I and II, respectively).Parameters besides E 0 and F were held at the default values in Table 1.At F = 0.2 (vertical dotted lines), conditions were identical to those in Figure 3B and D.
Trajectory Scores were more sensitive to food abundance, F , in this scenario than when larvae were spawned with sufficient energy for maintenance (Figures 5 and S4.6).With sufficient energy, relationships between F and J plateaued for each behavioral archetype at the first value of F where larvae could easily settle with E T ≥ 1.With insufficient energy, a second such transition occurred at the first value of F at which larvae could avoid starvation for the entirety of development (for example, see Figure S4.6D).This increased sensitivity suggested that producing larvae with insufficient energy for maintenance would be a risky strategy in environments where food abundance fluctuates over time.
Feeding larvae spawned with insufficient energy for maintenance were unlikely to return to shore with sufficient energy for metamorphosis under the upwelling, low food conditions we considered (Figure S4.7C-D).
Optimal behaviors prioritized starvation avoidance and settling with sufficient energy together over settling close to shore alone (Figures S4.7C  settling with enough energy for metamorphosis, all for feeding larvae spawned with insufficient energy for maintenance.Bars represent mean scores, with dark (light) bars corresponding with the nearshore (diurnal) predation schemes.Settling and Metamorphosis Scores did not depend on predation schemes, except that optimal behaviors were different for each scheme.Error bars represent interquartile ranges; note that some cases, mean Scores fell outside of these ranges.

Variations on Passive Drifting and DVM
Small details of how larval swimming behaviors are modeled can have unexpectedly large impacts on predictions of larval transport (Meyer et al, 2021;Sundelöf and Jonsson, 2012).Therefore, we repeated our analysis of behavioral archetypes for two alternative formulations of diel vertical migrations (DVM) and one alternative formulation of passive drifting.The DVM archetype in the main text featured larvae visiting the surface each night for six hours each night.We shall refer to this behavior as the DVM-6 archetype in this Supplement.The two alternatives visited the surface for three and 12 hours each night, and will be referred to as the DVM-3 and DVM-12 archetypes, respectively.The passive drifting behavior in the main text was described above Supplement 2 above.As an alternative, we considered the approximation from Meyer et al (2021), in which larvae switched between layers after exponentially distributed residence times.On average, visits to the surface and bottom layers lasted one and 13 hours, respectively.We will refer to these as the In the main text, we weighed predator avoidance, starvation avoidance, settling close to shore, and settling with energy for metamorphosis equally, p i = 1/4.This was a conservative assumption, since the relative contributions of predation, starvation, offshore wastage, and settling with inadequate energy to total larval mortality are generally considered poorly resolved and highly variable in nature (Morgan, 1995;Rumrill, 1990).In this supplement, we show that weighting one requirement more heavily than the others resulted in mostly subtle changes to the optimal swimming behaviors we computed.We remade Figure 3 from the main text using three alternate sets of weights that prioritized either predator avoidance (Figure S5.1), settling close to shore (Figure S5.2), or settling with more energy (Figure S5.3).We set the weight p starve = 0 for these cases because, as in Figure 3 in the main text, our default parameters were chosen such that starvation was nearly impossible.For conciseness, Table S5.1 summarizes key differences between the optimal larval trajectories in Figure 3  Table S5.1:Key differences between optimized larval trajectories when one of predator avoidance, settling close to shore, or settling with more energy is prioritized compared with when all three are equally important, as in the main text.Parameters besides the weights p i were fixed at the default values in main text Table 1.Hab.

Depth
Offshore Dist.
Offshore Dist..1:Optimized trajectories of simulated larvae subject to (A) nearshore predation in still water, (B) nearshore predation with upwelling, (C) diurnal predation in still water, and (D) diurnal predation with upwelling, with predator avoidance prioritized over settling site and energy.Diagrams in the top row illustrate these environmental conditions.Within each column, the solid black curves show the (I) depth, Z t , (II) offshore distance, X t , and (III) energy reserve, E t , of a median simulated larva under each set of conditions.The blue shading in (I) shows the fraction of several optimized larvae in the surface over time (right axis).The red and yellow curves in (II) and (III) each show 100 additional optimized trajectories X t and E t , respectively.Hab.

Depth
Offshore Dist.
Offshore Dist..2:Optimized trajectories of simulated larvae subject to (A) nearshore predation in still water, (B) nearshore predation with upwelling, (C) diurnal predation in still water, and (D) diurnal predation with upwelling, with settling close to shore prioritized over predator avoidance and settling energy.Diagrams in the top row illustrate these environmental conditions.Within each column, the solid black curves show the (I) depth, Z t , (II) offshore distance, X t , and (III) energy reserve, E t , of a median simulated larva under each set of conditions.The blue shading in (I) shows the fraction of several optimized larvae in the surface over time (right axis).The red and yellow curves in (II) and (III) each show 100 additional optimized trajectories X t and E t , respectively.Hab.

Depth
Offshore Dist.
Offshore Dist..3:Optimized trajectories of simulated larvae subject to (A) nearshore predation in still water, (B) nearshore predation with upwelling, (C) diurnal predation in still water, and (D) diurnal predation with upwelling, with energy at settling prioritized over predator avoidance and settling close to shore.Diagrams in the top row illustrate these environmental conditions.Within each column, the solid black curves show the (I) depth, Z t , (II) offshore distance, X t , and (III) energy reserve, E t , of a median simulated larva under each set of conditions.The blue shading in (I) shows the fraction of several optimized larvae in the surface over time (right axis).The red and yellow curves in (II) and (III) each show 100 additional optimized trajectories X t and E t , respectively.
In main text Figure 3 (and other figures like it), we were able to visualize offshore distance, X t , and energy content, E t , for many optimized larval trajectories under various conditions (e.g., red curves in row II and yellow curves in row III).However, because Z t ∈ {0, 1}, we were only able to visualize one depth trajectory per scenario (black curve in row I), along with the average of many such trajectories (blue in row 1).For completeness, Figure S6.1 shows additional simulations of Z t in the four scenarios considered in main text Figure 3: a species with feeding larvae spawned with E 0 = GT and a 20-day larval duration in environments with limited food, either nearshore or diurnal predation, and either still water or upwelling circulation.

Figure
Figure S2.1:Left: A single realization of the depth, z(t), of a passively floating larva.The blue dotted line, z = 0, separates the bottom and surface layers.Right: Proportions of the larval duration the process z(t) spends in each layer, averaged over 1000 simulations.
50, 12.5 are reflecting boundaries.(2.3)In equation (2.2), ζ(0), . . ., ζ(T − ∆t) are independent standard normal random variables and k z is the vertical eddy diffusivity of the coastal environment.In upwelling systems, the vertical eddy diffusivity is usually less than 100 m 2 d −1 and S3.2D).Optimal trajectories for feeding larvae with 80-day larval durations avoided starvation by spending a larger fraction of the second half of dispersal in the surface than larvae with a 20-day larval duration(Figures S3.1E and S3.2E).

Figure S3. 1 :
Figure S3.1:Nearshore predation, still water, low food/small surplus.Rows: (A) Default case of feeding larvae with 20-day larval duration spawned with enough energy for maintenance.(B) Nonfeeding larvae with 20-day larval duration and small surplus.(C) Feeding larvae with 20-day larval duration spawned with insufficient energy for maintenance.(D) Feeding larvae with 6-day larval duration spawned with enough energy for maintenance.(E) Feeding larvae with 80-day larval duration spawned with insufficient energy for maintenance.Columns: (I) Example depth trajectory Z t (left axis) and proportion of larvae in the surface (right axis and blue shading).(II) Example offshore distance traectories, X t .(III) Example energy trajectories, E t .The black examples in II and III correspond with the same example simulation in I.
-C and S3.4A-C).Over a shorter larval duration of only 6 days, larvae visited the surface at the start of dispersal for at least 2 days, and either remained there or returned later to feed, depending on food abundance (Figures S3.3D and S3.4D).Finally, over T = 80 days, trajectories consistently visited the surface for about 30 days in the lower food scenario and about 8 days in the higher food scenario(Figures S3.3E and S3.4E).
and S3.6B).Optimal swimming policies for feeding larvae were very different due to the conflicting needs of predation and starvation avoidance and metamorphosis, resembling the DVM and Hybrid archetypes (Figures S3.5 and S3.6, rows A and C-E).
and S3.8, row B).Feeding larvae, on the other hand, were forced to visit the surface to gather energy(Figures S3.7 and S3.8, rows A and C-E), particularly when spawned with insufficient energy for maintenance during dispersal (rows C and E in the same figures).Effects of energy at spawning.As in still water, insufficient energy at spawning resulted in a DVM-like optimal swimming policy unless food was abundant in the surface(Figures S3.7 and S3.8, rows C and E).When spawned with sufficient energy for maintenance throughout dispersal, optimal trajectories for larvae with a 20-day larval duration ceased regularly visiting the surface earlier(Figures S3.7 and S3.8, rows A and C).
and S3.8, rows A and C).Over a 6-day larval duration, optimal larval trajectories actually visited the surface less often when food was limited, since they struggled to gather sufficient energy for metamorphosis over such a short period(Figures S3.7 and   S3.8, row D).Finally, over a larval duration of 80 days, optimal trajectories visited the surface for at least the first 10 days of dispersal, and returned frequently to avoid starvation(Figures S3.7 and S3.8, row E).

Figures 4
Figures 4 and 5 in the main text compare the Trajectory Scores obtained by optimal swimming behaviors and the DVM, OVM, and Hybrid archetypes against passive drifting for various parameter values.Those figures clearly illustrate that vertical swimming can offer advantages over passive drifting, but perhaps the more relevant comparison is between the optima and the archetypes.We created Figures S4.1 and S4.2 to support this comparison; they are analogous to main text Figures4 and 5, respectively.In these figures, each panel compares Trajectory Scores from passive drifting or a behavioral archetype against those associated with the optimal behaviors.As noted in the text, the DVM archetype actually performed better than the optimum for larvae with a 20-day larval duration in an environment with weak upwelling, limited food, and diurnal predation (FigureS4.1B.II).Mathematically, this should not have been possible.It is probably not due to sampling error, since DVM remained super-optimal when we re-ran the code for this figure.We suspect this is an artifact due to interpolation-and discretization-related numerical errors in our optimization algorithm.
Figure S4.2:Relationships between Trajectory Scores, J, and feeding rate (a proxy for food abundance), F , for optimal vertical swimming behaviors (red in all panels), (A) passive drifting (gray), (B) the DVM archetype (purple), (C) the OVM archetype (orange), and (D) the Hybrid archetype (blue).We considered both the nearshore and diurnal predation schemes (rows I and II, respectively).Parameters besides F were held at the default values in main text Table1.At F = 0.2 (vertical dotted lines), conditions were identical to those in Figure3Band D.

Figure S4. 4 :
Figure S4.4:Success of the optimal swimming policy, passive drifting, and the DVM, OVM, and Hybrid archetypes with respect to (A) survival through metamorphosis, (B) avoiding predation, (C) settling close to shore, and (D) settling with enough energy for metamorphosis, all for nonfeeding larvae with the default parameters in Table1.Bars represent mean scores, with dark (light) bars corresponding with the nearshore (diurnal) predation schemes.Settling and Metamorphosis Scores did not depend on predation schemes, except that optimal behaviors were different for each scheme.Error bars represent interquartile ranges.
Figure S4.6:Relationships between Trajectory Scores, J, and feeding rate (a proxy for food abundance), F , for optimal vertical swimming behaviors (red in all panels), (A) passive drifting (gray), (B) the DVM archetype (purple), (C) the OVM archetype (orange), and (D) the Hybrid archetype (blue) for feeding larvae spawned with insufficient energy for maintenance, E 0 = 1.We considered both the nearshore and diurnal predation schemes (rows I and II, respectively).Parameters besides E 0 and F were held at the default values in Table1.At F = 0.2 (vertical dotted lines), conditions were identical to those in Figure3Band D.
Figures S3.3 and S3.7).The DVM, OVM, and Hybrid archetypes received similar mean Trajectory Scores (Figure S4.7A), since any behavior that successfully returned larvae to shore (e.g., OVM and Hybrid) failed to gather energy for metamorphosis, and vice versa.
Figure S4.7:Success of the optimal swimming policy, passive drifting, and the DVM, OVM, and Hybrid archetypes with respect to (A) survival through metamorphosis, (B) avoiding predation, (C) settling close to shore, and (D) settling with enough energy for metamorphosis, all for feeding larvae spawned with insufficient energy for maintenance.Bars represent mean scores, with dark (light) bars corresponding with the nearshore (diurnal) predation schemes.Settling and Metamorphosis Scores did not depend on predation schemes, except that optimal behaviors were different for each scheme.Error bars represent interquartile ranges; note that some cases, mean Scores fell outside of these ranges.
Figure S4.10:Success of Main and Alternate versions of passive drifting and the DVM-3, DVM-6, and DVM-12 swimming archetypes with respect to (A) survival through metamorphosis, (B) avoiding predation, (C) settling close to shore, and (D) settling with enough energy for metamorphosis.All parameters were fixed at the default values in Table1.Bars represent mean scores, with dark (light) bars corresponding with the nearshore (diurnal) predation schemes.Settling and Metamorphosis Scores did not depend on predation schemes, except that optimal behaviors were different for each scheme.Error bars represent interquartile ranges.
Figure S5.1:Optimized trajectories of simulated larvae subject to (A) nearshore predation in still water, (B) nearshore predation with upwelling, (C) diurnal predation in still water, and (D) diurnal predation with upwelling, with predator avoidance prioritized over settling site and energy.Diagrams in the top row illustrate these environmental conditions.Within each column, the solid black curves show the (I) depth, Z t , (II) offshore distance, X t , and (III) energy reserve, E t , of a median simulated larva under each set of conditions.The blue shading in (I) shows the fraction of several optimized larvae in the surface over time (right axis).The red and yellow curves in (II) and (III) each show 100 additional optimized trajectories X t and E t , respectively.
Figure S5.2:Optimized trajectories of simulated larvae subject to (A) nearshore predation in still water, (B) nearshore predation with upwelling, (C) diurnal predation in still water, and (D) diurnal predation with upwelling, with settling close to shore prioritized over predator avoidance and settling energy.Diagrams in the top row illustrate these environmental conditions.Within each column, the solid black curves show the (I) depth, Z t , (II) offshore distance, X t , and (III) energy reserve, E t , of a median simulated larva under each set of conditions.The blue shading in (I) shows the fraction of several optimized larvae in the surface over time (right axis).The red and yellow curves in (II) and (III) each show 100 additional optimized trajectories X t and E t , respectively.
Figure S5.3:Optimized trajectories of simulated larvae subject to (A) nearshore predation in still water, (B) nearshore predation with upwelling, (C) diurnal predation in still water, and (D) diurnal predation with upwelling, with energy at settling prioritized over predator avoidance and settling close to shore.Diagrams in the top row illustrate these environmental conditions.Within each column, the solid black curves show the (I) depth, Z t , (II) offshore distance, X t , and (III) energy reserve, E t , of a median simulated larva under each set of conditions.The blue shading in (I) shows the fraction of several optimized larvae in the surface over time (right axis).The red and yellow curves in (II) and (III) each show 100 additional optimized trajectories X t and E t , respectively.